package org.budo.spring.beans.factory.xml.namespace;

import org.budo.spring.beans.factory.xml.parser.async.AsyncReferenceBeanDefinitionParser;
import org.budo.spring.beans.factory.xml.parser.async.AsyncServiceBeanDefinitionParser;
import org.budo.spring.beans.factory.xml.parser.http.HttpReferenceBeanDefinitionParser;
import org.budo.spring.beans.factory.xml.parser.http.HttpServiceBeanDefinitionParser;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;

/**
 * @author lmw
 * @see org.springframework.beans.factory.xml.NamespaceHandler
 * @see org.springframework.beans.factory.xml.NamespaceHandlerSupport
 * @see org.springframework.transaction.config.TxNamespaceHandler
 * @see com.alibaba.druid.support.spring.stat.config.DruidStatNamespaceHandler
 * @see com.alibaba.dubbo.config.spring.schema.DubboNamespaceHandler
 */
public class BudoSpringNamespaceHandler extends NamespaceHandlerSupport {
    @Override
    public void init() {
        // http
        this.registerBeanDefinitionParser("http-service", new HttpServiceBeanDefinitionParser());
        this.registerBeanDefinitionParser("http-reference", new HttpReferenceBeanDefinitionParser());
        this.registerBeanDefinitionParser("http-ref", new HttpReferenceBeanDefinitionParser());

        // async
        this.registerBeanDefinitionParser("async-service", new AsyncServiceBeanDefinitionParser());
        this.registerBeanDefinitionParser("async-reference", new AsyncReferenceBeanDefinitionParser());
        this.registerBeanDefinitionParser("async-ref", new AsyncReferenceBeanDefinitionParser());
    }
}